import request from "@/utils/request"
/*/**
 * @description:广告列表接口
 * @param {type} query:查询条件对象,current:当前页码,size:展示几条数据
 * @return: promise
 */
export function ApiGetAdvertList(query, current = 1, size = 20) {
  return request({
    url: `/article/advert/search`,
    method: 'post',
    data: {
      ...query,
      current,
      size
    }
  })
}
/*/**
 * @description: 新增广告
 * @param {type} data:广告数据
 * @return: promise
 */
export function ApiPostAdvert(data) {
  return request({
    url: `/article/advert`,
    method: 'post',
    data
  })
}
/*/**
 * @description: 通过id查询对应广告数据
 * @param {type} id:点击对应广告id
 * @return: promise
 */
export function ApiGetAdvertId(id) {
  return request({
    url: `/article/advert/${id}`,
    method: 'get'
  })
}
/*/**
 * @description: 编辑广告
 * @param {type} data:广告数据
 * @return: promise
 */
export function ApiPutAdvertEdit(data) {
  return request({
    url: `/article/advert`,
    method: 'put',
    data
  })
}
/*/**
 * @description: 通过id删除对应广告数据
 * @param {type} id:点击对应广告id
 * @return: promise
 */
export function ApiDeleteAdvertId(id) {
  return request({
    url: `/article/advert/${id}`,
    method: 'delete'
  })
}
